
{extend name="AdminEx/index" /}

{block name="main"}
        <!-- page heading start-->
        <div class="page-heading">
            <h3>
                {$title}
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="#">图书管理</a>
                </li>
                <li class="active"> 新增图书 </li>
            </ul>
        </div>
        <!-- page heading end-->

        <!--body wrapper start-->
        <div class="wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <section class="panel">
                        <header class="panel-heading">
                           添加图书
                        </header>
                        <div class="panel-body">
                            <form  action="{:url('admin/Book/save')}" enctype="multipart/form-data" method="post" 
                            role="form" class="form-horizontal adminex-form">
                                <div class="form-group has-success">
                                    <label class="col-lg-2 control-label">封面</label>
                                    <div class="col-lg-10">
                                        <input name="face" type="file" id="f-name">
                                    </div>
                                </div>
                                <div class="form-group has-success">
                                    <label class="col-lg-2 control-label">属类</label>
                                    <div class="col-lg-3">
                                        <select name="cid" type="text" class="form-control">
                                            {volist name="list" id="v"}
                                                <option value="{$v.id}" class="one" disabled>{$v.name}</option>
                                                {volist name="v.list" id="vo"}
                                                    <option value="{$vo.id}" class="two">----{$vo.name}</option>
                                                {/volist}
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group has-success">
                                    <label class="col-lg-2 control-label">书名</label>
                                    <div class="col-lg-10">
                                        <input name="name" type="text" placeholder="" id="f-name" class="form-control">
                                    </div>
                                </div>
                                <div class="form-group has-success">
                                    <label class="col-lg-2 control-label">作者</label>
                                    <div class="col-lg-10">
                                        <input name="author" type="text" placeholder="" id="f-name" class="form-control">
                                    </div>
                                </div>
                                <div class="form-group has-success">
                                    <label class="col-lg-2 control-label">价格</label>
                                    <div class="col-lg-10">
                                        <input name="price" type="text" placeholder="" id="f-name" class="form-control">
                                    </div>
                                </div>
                                <div class="form-group has-success">
                                    <label class="col-lg-2 control-label">版权</label>
                                    <div class="col-lg-10">
                                        <input name="copyright" type="text" placeholder="" id="f-name" class="form-control">
                                    </div>
                                </div>
                                <div class="form-group has-success">
                                    <label class="col-lg-2 control-label">标签</label>
                                    <div class="col-lg-10">
                                        <input name="tag" type="text" placeholder="" id="f-name" class="form-control">
                                    </div>
                                </div>
                                <div class="form-group has-success">
                                    <label class="col-lg-2 control-label">发行日</label>
                                    <div class="col-lg-10">
                                        <input name="ctime" type="text" placeholder="2018-09-01" id="f-name" class="form-control">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-lg-offset-2 col-lg-10">
                                        <button class="btn btn-primary" type="submit">Submit</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </section>
                </div>
            </div>

{/block}

{block name="myjs"}
<script type="text/javascript">
    $('.one').last().attr("disabled", false);
    $('.one').last().prev().attr("disabled", false);
</script>
{/block}